package org.web.datajpa.exception;


import lombok.Getter;
import lombok.Setter;
import org.web.datajpa.constant.ResultEnum;

@Getter
@Setter
public class ResultException extends RuntimeException {
    private Integer code;
    // 继承
    public ResultException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }
    // 重载
    public ResultException(String msg) {
        super(msg);
    }
    // 枚举
    public ResultException(ResultEnum resultEnum) {
        super(resultEnum.getMsg());
        this.code = resultEnum.getCode();
    }

}
